Skip to content

Commit 87fc845

Browse files
authored
import of v0.29.1 (#1865)
1 parent 8f93764 commit 87fc845

11 files changed

+318
-69
lines changed

CHANGES.md

Lines changed: 108 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,58 @@ Change log
33

44
All notable changes to this program are documented in this file.
55

6+
0.29.1 (2021-04-09), `970ef713fe58`)
7+
-------------------------------------
8+
9+
### Known problems
10+
11+
- _macOS 10.15 (Catalina):_
12+
13+
Due to the requirement from Apple that all programs must be
14+
notarized, geckodriver will not work on Catalina if you manually
15+
download it through another notarized program, such as Firefox.
16+
17+
Whilst we are working on a repackaging fix for this problem, you can
18+
find more details on how to work around this issue in the [macOS
19+
notarization] section of the documentation.
20+
21+
- _Android:_
22+
23+
Marionette will only be enabled in GeckoView based applications when the
24+
Firefox preference `devtools.debugger.remote-enabled` is set to `True` via
25+
[`moz:firefoxOptions`]. This will be fixed in one of the upcoming Firefox
26+
for Android releases.
27+
28+
### Added
29+
30+
- When testing GeckoView based applications on Android it's now enough to
31+
specify the `androidPackage` capability. The appropriate activity name,
32+
and required intent arguments will now automatically be used for
33+
applications released by Mozilla.
34+
35+
- Native AArch64 (M1) builds of geckodriver for MacOS are now available. These
36+
are currently shipped as Tier2 due to missing test infrastructure. Please let
37+
us know if you experience issues.
38+
39+
### Fixed
40+
41+
- Fixed a stack overflow crash in thread 'webdriver dispatcher' when
42+
handling certain device errors.
43+
44+
- Fixed an application crash due to missing permissions on unrooted devices
45+
by changing the location of the test related files, e.g the profile folder.
46+
Therefore the deprecated --android-storage command line argument
47+
now defaults to the `sdcard` option, which changed its location to
48+
`$EXTERNAL_STORAGE/Android/data/%androidPackage%/files/`. With this change
49+
proper support for unrooted devices running Android 10+ has been added.
50+
51+
_Note_: Do not use the --android-storage command line argument
52+
anymore unless there is a strong reason. It will be removed in a future
53+
release.
54+
55+
656
0.29.0 (2021-01-14, `cf6956a5ec8e`)
7-
--------------------
57+
------------------------------------
858

959
### Known problems
1060

@@ -18,6 +68,20 @@ All notable changes to this program are documented in this file.
1868
find more details on how to work around this issue in the [macOS
1969
notarization] section of the documentation.
2070

71+
- _Android:_
72+
73+
Marionette will only be enabled in GeckoView based applications when the
74+
Firefox preference `devtools.debugger.remote-enabled` is set to `True` via
75+
[`moz:firefoxOptions`]. This will be fixed in one of the upcoming Firefox
76+
for Android releases.
77+
78+
In some cases geckodriver could crash due to a stack overflow when handling
79+
certain device errors.
80+
81+
On unrooted Android 10+ devices startup crashes of the application can be
82+
experienced due to an inappropriate location of test related files, e.g the
83+
profile folder.
84+
2185
### Added
2286

2387
- Introduced the new boolean capability `moz:debuggerAddress` that can be used
@@ -30,7 +94,7 @@ All notable changes to this program are documented in this file.
3094
Firefox aka [Fission] will be not available.
3195

3296
0.28.0 (2020-11-03, `c00d2b6acd3f`)
33-
--------------------
97+
------------------------------------
3498

3599
### Known problems
36100

@@ -44,6 +108,20 @@ All notable changes to this program are documented in this file.
44108
find more details on how to work around this issue in the [macOS
45109
notarization] section of the documentation.
46110

111+
- _Android:_
112+
113+
Marionette will only be enabled in GeckoView based applications when the
114+
Firefox preference `devtools.debugger.remote-enabled` is set to `True` via
115+
[`moz:firefoxOptions`]. This will be fixed in one of the upcoming Firefox
116+
for Android releases.
117+
118+
In some cases geckodriver could crash due to a stack overflow when handling
119+
certain device errors.
120+
121+
On unrooted Android 10+ devices startup crashes of the application can be
122+
experienced due to an inappropriate location of test related files, e.g the
123+
profile folder.
124+
47125
### Added
48126

49127
- The command line flag `--android-storage` has been added, to allow geckodriver
@@ -66,7 +144,7 @@ All notable changes to this program are documented in this file.
66144
and querying its attributes are no longer needed, and have been removed.
67145

68146
0.27.0 (2020-07-27, `7b8c4f32cdde`)
69-
--------------------
147+
------------------------------------
70148

71149
### Security Fixes
72150

@@ -92,10 +170,20 @@ All notable changes to this program are documented in this file.
92170
find more details on how to work around this issue in the [macOS
93171
notarization] section of the documentation.
94172

173+
- _Android:_
174+
175+
Marionette will only be enabled in GeckoView based applications when the
176+
Firefox preference `devtools.debugger.remote-enabled` is set to `True` via
177+
[`moz:firefoxOptions`]. This will be fixed in one of the upcoming Firefox
178+
for Android releases.
179+
180+
In some cases geckodriver could crash due to a stack overflow when handling
181+
certain device errors.
182+
95183
### Added
96184

97185
- To set environment variables for the launched Firefox for Android,
98-
it is now possible to add an `env` object on `moz:firefoxOptions`
186+
it is now possible to add an `env` object on [`moz:firefoxOptions`]
99187
(note: this is not supported for Firefox Desktop)
100188

101189
- Support for print-to-PDF
@@ -126,7 +214,7 @@ All notable changes to this program are documented in this file.
126214
- Windows and Linux binaries are again statically linked.
127215

128216
0.26.0 (2019-10-12, `e9783a644016'`)
129-
------------------------------------
217+
-------------------------------------
130218

131219
Note that with this release the minimum recommended Firefox version
132220
has changed to Firefox ≥60.
@@ -149,6 +237,16 @@ has changed to Firefox ≥60.
149237
runtime] installed on your system for the binary to run. This
150238
is a known bug which we weren't able fix for this release.
151239

240+
- _Android:_
241+
242+
Marionette will only be enabled in GeckoView based applications when the
243+
Firefox preference `devtools.debugger.remote-enabled` is set to `True` via
244+
[`moz:firefoxOptions`]. This will be fixed in one of the upcoming Firefox
245+
for Android releases.
246+
247+
In some cases geckodriver could crash due to a stack overflow when handling
248+
certain device errors.
249+
152250
### Added
153251

154252
- Support for Firefox on Android
@@ -522,7 +620,7 @@ Firefox and Selenium versions have changed:
522620

523621
- Firefox will now be started with the `-foreground` and `-no-remote`
524622
flags if they have not already been specified by the user in
525-
`moz:firefoxOptions`.
623+
[`moz:firefoxOptions`].
526624

527625
`-foreground` will ensure the application window gets focus when
528626
Firefox is started, and `-no-remote` will prevent remote commands
@@ -732,7 +830,7 @@ Note that with geckodriver 0.19.0 the following versions are recommended:
732830

733831
- To pick up a prepared profile from the filesystem, it is now possible
734832
to pass `["-profile", "/path/to/profile"]` in the `args` array on
735-
`moz:firefoxOptions`
833+
[`moz:firefoxOptions`]
736834

737835
- geckodriver now recommends Firefox 53 and greater
738836

@@ -882,7 +980,7 @@ and greater.
882980
- Fix broken unmarshaling of _Get Timeouts_ response format from Firefox
883981
52 and earlier (fixed by [Jason Juang])
884982

885-
- Allow preferences in `moz:firefoxOptions` to be both positive- and
983+
- Allow preferences in [`moz:firefoxOptions`] to be both positive- and
886984
negative integers (fixed by [Jason Juang])
887985

888986
- Allow IPv6 hostnames in the proxy configuration object
@@ -1035,7 +1133,7 @@ and greater.
10351133
`/session/{sessionId}/moz/xbl/{elementId}/anonymous_by_attribute` to
10361134
return an anonymous element by a name and attribute query
10371135

1038-
- Introduced a `moz:firefoxOptions` capability to customise a Firefox
1136+
- Introduced a [`moz:firefoxOptions`] capability to customise a Firefox
10391137
session:
10401138

10411139
- The `binary`, `args`, and `profile` entries on this dictionary
@@ -1054,7 +1152,7 @@ and greater.
10541152
### Changed
10551153

10561154
- `firefox_binary`, `firefox_args`, and `firefox_profile` capabilities
1057-
removed in favour of the `moz:firefoxOptions` dictionary detailed above
1155+
removed in favour of the [`moz:firefoxOptions`] dictionary detailed above
10581156
and in the [README]
10591157

10601158
- Removed `--no-e10s` flag, and geckodriver will from now rely on the

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "geckodriver"
3-
version = "0.29.0"
3+
version = "0.29.1"
44
description = "Proxy for using WebDriver clients to interact with Gecko-based browsers."
55
keywords = ["webdriver", "w3c", "httpd", "mozilla", "firefox"]
66
repository = "https://hg.mozilla.org/mozilla-central/file/tip/testing/geckodriver"
@@ -17,8 +17,8 @@ hyper = "0.13"
1717
lazy_static = "1.0"
1818
log = { version = "0.4", features = ["std"] }
1919
marionette = { path = "./marionette" }
20-
mozdevice = "0.3.1"
21-
mozprofile = "0.7.1"
20+
mozdevice = "0.3.2"
21+
mozprofile = "0.7.2"
2222
mozrunner = "0.12.1"
2323
mozversion = "0.4.1"
2424
regex = { version="1.0", default-features = false, features = ["perf", "std"] }
@@ -27,7 +27,7 @@ serde_derive = "1.0"
2727
serde_json = "1.0"
2828
serde_yaml = "0.8"
2929
uuid = { version = "0.8", features = ["v4"] }
30-
webdriver = "0.43.0"
30+
webdriver = "0.43.1"
3131
zip = { version = "0.4", default-features = false, features = ["deflate"] }
3232

3333
[[bin]]

doc/Flags.md

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ Flags
33

44
#### <code>&#x2D;&#x2D;android-storage <var>ANDROID_STORAGE</var></code>
55

6+
**Deprecation warning**: This argument is deprecated and planned to be removed
7+
with the 0.31.0 release of geckodriver. As such it shouldn't be used with version
8+
0.30.0 or later anymore. By default the automatic detection will now use the
9+
external storage location, which is always readable and writeable.
10+
611
Selects the test data location on the Android device, eg. the Firefox profile.
712
By default `auto` is used.
813

@@ -40,10 +45,9 @@ By default `auto` is used.
4045
shell user. Commands will be executed via <code>su</code>.
4146
<tr>
4247
<td>sdcard
43-
<td><p>Location: <code>/mnt/sdcard/test_root</code></p>
44-
This location is not supported on Android 11+ due to the
45-
<a href="https://developer.android.com/about/versions/11/privacy/storage">
46-
changes related to scoped storage</a>.
48+
<td><p>Location: <code>$EXTERNAL_STORAGE/Android/data/%androidPackage%/files/test_root</code></p>
49+
This location is supported by all versions of Android whether if the device
50+
is rooted or not.
4751
</table>
4852

4953

@@ -135,6 +139,33 @@ system to atomically assign a free port.
135139
Attach [browser toolbox] debugger when Firefox starts. This is
136140
useful for debugging [Marionette] internals.
137141

142+
To be prompted at the start of the test run or between tests,
143+
you can set the `marionette.debugging.clicktostart` preference to
144+
`true`.
145+
146+
For reference, below is the list of preferences that enables the
147+
chrome debugger. These are all set implicitly when the
148+
argument is passed to geckodriver.
149+
150+
* `devtools.browsertoolbox.panel` -> `jsdebugger`
151+
152+
Selects the Debugger panel by default.
153+
154+
* `devtools.chrome.enabled` → true
155+
156+
Enables debugging of chrome code.
157+
158+
* `devtools.debugger.prompt-connection` → false
159+
160+
Controls the remote connection prompt. Note that this will
161+
automatically expose your Firefox instance to localhost.
162+
163+
* `devtools.debugger.remote-enabled` → true
164+
165+
Allows a remote debugger to connect, which is necessary for
166+
debugging chrome code.
167+
168+
138169
[browser toolbox]: https://developer.mozilla.org/en-US/docs/Tools/Browser_Toolbox
139170

140171

doc/Releasing.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ If a feature was added but removed before release, there is no reason
6060
to list it as a change.
6161

6262
It is good practice to also include relevant information from the
63-
[webdriver] and [rust-mozrunner] crates, since these are the two most
64-
important dependencies of geckodriver and a lot of its functionality
65-
is implemented there.
63+
[webdriver], [rust-mozrunner], and [rust-mozdevice] crates, since these
64+
are the most important dependencies of geckodriver and a lot of its
65+
functionality is implemented there.
6666

6767
We follow the writing style of the existing change log, with
6868
one section per version (with a release date), with subsections
@@ -73,8 +73,9 @@ to make the file readable in a text editor as well as rendered HTML.
7373
fmt(1) does a splendid job at text formatting.
7474

7575
[CHANGES.md]: https://searchfox.org/mozilla-central/source/testing/geckodriver/CHANGES.md
76+
[webdriver]: https://searchfox.org/mozilla-central/source/testing/webdriver
7677
[rust-mozrunner]: https://searchfox.org/mozilla-central/source/testing/mozbase/rust/mozrunner
77-
78+
[rust-mozdevice]: https://searchfox.org/mozilla-central/source/testing/mozbase/rust/mozdevice
7879

7980
Update libraries
8081
----------------

doc/Support.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ and required versions of Selenium and Firefox:
2222
<th>max
2323
</tr>
2424
</thead>
25-
25+
<tr>
26+
<td>0.29.1
27+
<td>≥ 3.11 (3.14 Python)
28+
<td>60
29+
<td>n/a
2630
<tr>
2731
<td>0.29.0
2832
<td>≥ 3.11 (3.14 Python)

src/android.rs

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,18 @@ impl AndroidHandler {
171171
buf
172172
}
173173
AndroidStorage::Internal => PathBuf::from("/data/local/tmp/test_root"),
174-
AndroidStorage::Sdcard => PathBuf::from("/mnt/sdcard/test_root"),
174+
AndroidStorage::Sdcard => {
175+
// We need to push the profile to a location on the device that can also
176+
// be read and write by the application, and works for unrooted devices.
177+
// The only location that meets this criteria is under:
178+
// $EXTERNAL_STORAGE/Android/data/%options.package%/files
179+
let response = device.execute_host_shell_command("echo $EXTERNAL_STORAGE")?;
180+
let mut buf = PathBuf::from(response.trim_end_matches('\n'));
181+
buf.push("Android/data");
182+
buf.push(&options.package);
183+
buf.push("files/test_root");
184+
buf
185+
}
175186
};
176187

177188
debug!(
@@ -431,7 +442,19 @@ mod test {
431442
buf
432443
}
433444
AndroidStorage::Internal => PathBuf::from("/data/local/tmp/test_root"),
434-
AndroidStorage::Sdcard => PathBuf::from("/mnt/sdcard/test_root"),
445+
AndroidStorage::Sdcard => {
446+
let response = handler
447+
.process
448+
.device
449+
.execute_host_shell_command("echo $EXTERNAL_STORAGE")
450+
.unwrap();
451+
452+
let mut buf = PathBuf::from(response.trim_end_matches('\n'));
453+
buf.push("Android/data/");
454+
buf.push(&package);
455+
buf.push("files/test_root");
456+
buf
457+
}
435458
};
436459
assert_eq!(handler.test_root, test_root);
437460

0 commit comments

Comments
 (0)